package cn.cvs.pojo;

import org.hibernate.validator.constraints.Length;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * 便利店供货商类
 * @author project.cvs.team
 */
@Scope("prototype")
@Component
public class Supplier implements java.io.Serializable {
	
	private Integer id;   			//id
    @Length(min = 9,max = 12,message = "编码格式错了")
	private String supCode; 		//供货商编码
	private String supName; 		//供货商名称
	private String supDesc; 		//供货商备注
	private String supContact;		//供货商联系人
	private String supPhone; 		//供货商电话
	private String supAddress; 	//供货商地址
	private String supFax; 		//供货商传真
	private Integer createdUserId;//创建者
	private Date createdTime; 	//创建时间
	private Integer updatedUserId;//更新者
	private Date updatedTime;		//更新时间

    //扩展属性 多对一映射   仓库进货表
    private List<StorageRecord> storageRecord;

    private String companyLicPic;//企业营业执照
    private String orgCodePic;//组织机构代码证

    public String getCompanyLicPic() {
        return companyLicPic;
    }

    public void setCompanyLicPic(String companyLicPic) {
        this.companyLicPic = companyLicPic;
    }

    public String getOrgCodePic() {
        return orgCodePic;
    }

    public void setOrgCodePic(String orgCodePic) {
        this.orgCodePic = orgCodePic;
    }

    public List<StorageRecord> getStorageRecord() {
        return storageRecord;
    }

    public void setStorageRecord(List<StorageRecord> storageRecord) {
        this.storageRecord = storageRecord;
    }

    public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getSupCode() {
		return supCode;
	}
	public void setSupCode(String supCode) {
		this.supCode = supCode;
	}
	public String getSupName() {
		return supName;
	}
	public void setSupName(String supName) {
		this.supName = supName;
	}
	public String getSupDesc() {
		return supDesc;
	}
	public void setSupDesc(String supDesc) {
		this.supDesc = supDesc;
	}
	public String getSupContact() {
		return supContact;
	}
	public void setSupContact(String supContact) {
		this.supContact = supContact;
	}
	public String getSupPhone() {
		return supPhone;
	}
	public void setSupPhone(String supPhone) {
		this.supPhone = supPhone;
	}
	public String getSupAddress() {
		return supAddress;
	}
	public void setSupAddress(String supAddress) {
		this.supAddress = supAddress;
	}
	public String getSupFax() {
		return supFax;
	}
	public void setSupFax(String supFax) {
		this.supFax = supFax;
	}
	public Integer getCreatedUserId() {
		return createdUserId;
	}
	public void setCreatedUserId(Integer createdUserId) {
		this.createdUserId = createdUserId;
	}
	public Date getCreatedTime() {
		return createdTime;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	public Integer getUpdatedUserId() {
		return updatedUserId;
	}
	public void setUpdatedUserId(Integer updatedUserId) {
		this.updatedUserId = updatedUserId;
	}
	public Date getUpdatedTime() {
		return updatedTime;
	}
	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}

    public Supplier() {
    }

    public Supplier(Integer id, String supCode, String supName, String supDesc, String supContact, String supPhone, String supAddress, String supFax, Integer createdUserId, Date createdTime, Integer updatedUserId, Date updatedTime) {
        this.id = id;
        this.supCode = supCode;
        this.supName = supName;
        this.supDesc = supDesc;
        this.supContact = supContact;
        this.supPhone = supPhone;
        this.supAddress = supAddress;
        this.supFax = supFax;
        this.createdUserId = createdUserId;
        this.createdTime = createdTime;
        this.updatedUserId = updatedUserId;
        this.updatedTime = updatedTime;
    }

    @Override
    public String toString() {
//        return "Supplier{" +
//                "id=" + id +
//                ", supCode='" + supCode + '\'' +
//                ", supName='" + supName + '\'' +
//                ", storageRecord=" + storageRecord +
//                '}'+"\n";
        return "Supplier{" +
                "id=" + id +
                ", supCode='" + supCode + '\'' +
                ", supName='" + supName + '\'' +
                ", supDesc='" + supDesc + '\'' +
                ", supContact='" + supContact + '\'' +
                ", supPhone='" + supPhone + '\'' +
                ", supAddress='" + supAddress + '\'' +
                ", supFax='" + supFax + '\'' +
                ", createdUserId=" + createdUserId +
                ", createdTime=" + createdTime +
                ", updatedUserId=" + updatedUserId +
                ", updatedTime=" + updatedTime +
                ", storageRecord=" + storageRecord +
                '}'+"\n";
    }
}
